#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\IIT.h>

const char*IITName = "IIT.dat";

static IIT_REC srIITRec;

static int recordNum;
int	inLoadIITRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(IIT_FILENAME, SIZE_IIT_REC, inRecNumber, (char *) &srIITRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetIITRec(void)
{
	return &srIITRec;

}

int	inSaveIITRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(IIT_FILENAME, SIZE_IIT_REC, inRecNumber, (char *) &srIITRec);

	return inRet;
}

int	inGetIITRecNumber (void)
{
	return recordNum;
}

int	inUpdateIITRec (void)
{
	int inRet;

	inRet = inSaveConfRec(IIT_FILENAME, SIZE_IIT_REC, recordNum, (char *) &srIITRec);

	return inRet;
}

void	vdResetIITRec (void)
{
	memset((void*)&srIITRec, 0, REC_SIZEOF(srIITRec));
}

short inGetIssuerNumber(void)
{
	return srIITRec.inIssuerNumber;
}

void vdSetIssuerNumber(short inIssuerNumber)
{
	srIITRec.inIssuerNumber = inIssuerNumber;
}

char* szGetIssuerAbbrev(void)
{
	return srIITRec.szIssuerAbbrev;
}

void vdSetIssuerAbbrev(const char* szIssuerAbbrev)
{
	strNumCopy(srIITRec.szIssuerAbbrev, szIssuerAbbrev, sizeof(((IIT_REC*)NULL)->szIssuerAbbrev)-1);
}

char* szGetIssuerLabel(void)
{
	return srIITRec.szIssuerLabel;
}

void vdSetIssuerLabel(const char* szIssuerLabel)
{
	strNumCopy(srIITRec.szIssuerLabel, szIssuerLabel, sizeof(((IIT_REC*)NULL)->szIssuerLabel)-1);
}

char* szGetPANFormat(void)
{
	return srIITRec.szPANFormat;
}

void vdSetPANFormat(const char* szPANFormat)
{
	strNumCopy(srIITRec.szPANFormat, szPANFormat, sizeof(((IIT_REC*)NULL)->szPANFormat)-1);
}

VS_BOOL fGetMerchExpDate(void)
{
	return srIITRec.fMerchExpDate;
}

void vdSetMerchExpDate(VS_BOOL fMerchExpDate)
{
	srIITRec.fMerchExpDate = fMerchExpDate;
}

VS_BOOL fGetCustExpDate(void)
{
	return srIITRec.fCustExpDate;
}

void vdSetCustExpDate(VS_BOOL fCustExpDate)
{
	srIITRec.fCustExpDate = fCustExpDate;
}

VS_BOOL fGetMerchPANFormat(void)
{
	return srIITRec.fMerchPANFormat;
}

void vdSetMerchPANFormat(VS_BOOL fMerchPANFormat)
{
	srIITRec.fMerchPANFormat = fMerchPANFormat;
}

